﻿@{
    Layout = null;
    int z = 0;
}
@model EnterpriseFund.Model.UpLevelAllowance
<!DOCTYPE html>
@Html.Partial("LoadPanelPartial")
<html>
<head>
    <title>UpLevelAllowanceEdit</title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script>
        $(document).ready(function () {
            $("#toolMenu").smartFloat();
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
            if (hdjsAlert == "操作成功") {
                window.location.href = rootPath + '/UpLevelAllowanceAudit/';
            }
        });


        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSubmit":
                    {
                        Save('open');
                        break;
                    }
                case "btnReturn":
                    {
                        //  Save('Return');
                        var codeNo = $("#hidFUpLevelAllowanceID").val();
                        var rs = window.showModalDialog(rootPath + "/ReturnDlg?tableName=t_UpLevelAllowance&id=" + codeNo + "&feq=20");
                        if (rs == "S") {
                            window.location.href = rootPath + '/UpLevelAllowanceAudit/';
                        }

                        break;
                    }
                case "btnback":
                    {
                        window.location.href = rootPath + '/UpLevelAllowanceAudit/';
                        break;
                    }
            }

        }


        function Save(FStatus) {
            $("#hidFStatus").val(FStatus);
            form1.submit();
        }
    </script>
    <style>
        .tableStyle
        {
            width: 100%;
            border: solid 1px black;
            padding: 6px 5px;
            border-collapse: collapse;
        }
        .tableStyle td
        {
        }
        
        .tableStyle .tdClass
        {
            padding: 0px;
            padding: 6px 5px;
            border: solid 1px black;
        }
        .tableStyle th
        {
            text-align: right;
            padding: 6px 5px;
            border: solid 1px black;
        }
        .tableStyle .button
        {
            margin: 2px 0px 0px 2px;
            float: left;
        }
        
        text
        {
            border: 1px solid #aecaf0;
        }
    </style>
</head>
<body>
    @using (Html.BeginForm("Save", "UpLevelAllowanceAudit", FormMethod.Post, new { id = "form1" }))
    {
        @Html.DevExpress().Menu(settings =>
   {
       settings.Name = "toolBarMenu";
       settings.ItemAutoWidth = false;
       settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
       settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
       settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
       settings.Items.Add(item =>
       {
           item.Name = "btnSubmit";
           item.Text = "发送";
           item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");
       });
       settings.Items.Add(item =>
       {
           item.Name = "btnReturn";
           item.Text = "退回";
           item.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
       });
       settings.Items.Add(item =>
       {
           item.Name = "btnback";
           item.Text = "返回";
           item.Image.Url = Url.Content("~/Content/ControlImages/back.png");
       });
       settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
       settings.ItemLinkMode = ItemLinkMode.ContentBounds;
   }).GetHtml()
        <div>
            <table width="100%">
                <tr>
                    <td align="center" valign="middle" colspan="2">
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        文号:
                    </td>
                    <td>
                        @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FFileNo";
                       settings.Width = 150;
                       settings.Text = Model.FFileNo;
                       settings.Enabled = false;
                       settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                       settings.Properties.ValidationSettings.EnableCustomValidation = true;
                   }).GetHtml()
                    </td>
                    <td align="right">
                        文件名称:
                    </td>
                    <td>
                        @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FFileName";
                       settings.Width = 150;
                       settings.Text = Model.FFileName;
                       settings.Enabled = false;
                       settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                       settings.Properties.ValidationSettings.EnableCustomValidation = true;
                   }).GetHtml()
                    </td>
                    <td align="right">
                        其他补助类型：
                    </td>
                    <td>
                        @Html.DevExpress().ComboBox(settings =>
                   {
                       settings.Name = "FUpLevelAllowanceClsNo";
                       settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                       settings.Width = 100;
                       settings.Properties.TextField = "FUpLevelAllowanceClsName";
                       settings.Properties.ValueField = "FUpLevelAllowanceClsNo";
                       settings.Enabled = false;
                   }).BindList(ViewData["UpLevelAllowanceClsList"]).Bind(Model.FUpLevelAllowanceClsNo).GetHtml()
                    </td>
                    <td style="width: 10%" align="right">
                        经济类型：
                    </td>
                    <td>
                        @Html.DevExpress().ComboBox(settings =>
                   {
                       settings.Name = "FFinancePropNo";
                       settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                       settings.Width = 100;
                       settings.Properties.TextField = "FFinancePropShortName";
                       settings.Properties.ValueField = "FFinancePropNo";
                       settings.Properties.EnableClientSideAPI = true;
                       settings.Enabled = false;
                   }).BindList(ViewData["FinancePropList"]).Bind(Model.FFinancePropNo).GetHtml()
                    </td>
                </tr>
            </table>
            <table class="tableStyle">
                <tr>
                    <td class="tdClass" style="width: 40%" align="center">
                        纳税人名称
                    </td>
                    <td class="tdClass" style="width: 15%" align="center">
                        金额
                    </td>
                    <td class="tdClass" style="width: 45%" align="center">
                        备注
                    </td>
                </tr>
                @if (ViewData["showdata"] != null)
                {

                    foreach (System.Data.DataRow dr in (ViewData["showdata"] as System.Data.DataTable).Rows)
                    {
                        z++;

                    <tr id="@dr["NSRDZDAH"]">
                        <td class="tdClass" align="left">@dr["NSRMC"]
                        </td>
                        @if (dr["NSRMC"].ToString() == "合计")
                        {
                           <td class="tdClass" align="right" id='@dr["NSRDZDAH"]je'>@dr["FUpLevelAmount"] 
                            </td>
                        }
                        else
                        {
                            string amountcount = (decimal.Parse(dr["FLocalAmount"].ToString()) + decimal.Parse(dr["FUpLevelAmount"].ToString())).ToString();
                            <td class="tdClass" align="right" id='@dr["NSRDZDAH"]je'>@amountcount
                            </td>
                        }
                        <td class="tdClass" align="center">@dr["FNote"]
                        </td>
                    </tr>
          
                    }
                }
            </table>
        </div>

        @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));
        @Html.Hidden("hidFUpLevelAllowanceID", (ViewData["FUpLevelAllowanceID"]));                                        
        @Html.Hidden("hidFStatus", "");

    }
</body>
</html>
